/*
 * endian.h
 *
 * Created: 8/21/2013 3:14:10 PM
 *  Author: Ken Arok
 *
 * \brief Endianness Utilities.
 *
 * Copyright (c) 2013 PT Hanindo Automation Solutions. All rights reserved.
 *
 */


#ifndef ENDIAN_H_
#define ENDIAN_H_

#include <stdint.h>

/* \brief Store a byte of data to memory in Big Endian.
 *
 * \param addr	Pointer to memory address where data will be stored.
 * \param data	Data want to be stored.
 *
 */
extern void BigEndian_StoreByte(void *addr, unsigned char data);

/* \brief Store a word of data to memory in Big Endian.
 *
 * \param addr	Pointer to memory address where data will be stored.
 * \param data	Data want to be stored.
 *
 */
extern void BigEndian_StoreWord(void *addr, unsigned short data);

/* \brief Store a double word of data to memory in Big Endian.
 *
 * \param addr	Pointer to memory address where data will be stored.
 * \param data	Data want to be stored.
 *
 */
extern void BigEndian_StoreDWord(void *addr, unsigned long data);

/* \brief Load a byte of data from memory in Big Endian.
 *
 * \param addr	Pointer to memory address where data will be copied.
 *
 * \return Data.
 *
 */
extern unsigned char BigEndian_LoadByte(void *addr);

/* \brief Load a word of data from memory in Big Endian.
 *
 * \param addr	Pointer to memory address where data will be copied.
 *
 * \return Data.
 *
 */
extern unsigned short BigEndian_LoadWord(void *addr);

/* \brief Load a double word of data from memory in Big Endian.
 *
 * \param addr	Pointer to memory address where data will be copied.
 *
 * \return Data.
 *
 */
extern unsigned long BigEndian_LoadDWord(void *addr);



#endif /* ENDIAN_H_ */
